package com.castudio.COS.qiniu;

import com.castudio.COS.qiniu.service.QiNiuService;
import com.castudio.CaStudioApplication;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.File;

@SpringBootTest(classes = CaStudioApplication.class)
public class QinNiuTest2 {

    @Autowired
    private QiNiuService qiniuService;

    @Test
    public void testUploadFile() throws Exception {
        String result = qiniuService.uploadFile(new File("D://学校课程//软件工程//lab03_版本管理//2140129356-杨力-实验3版本管理.doc"),"VCS");
        // 地址： http://s0ymd28vr.hn-bkt.clouddn.com/hello world
        System.out.println("访问地址： " + result);
    }

    @Test
    public void testRemoveFile() throws Exception{
        Boolean result = qiniuService.removeFile("castudio", "hello world");
        System.out.println("删除结果：" + result);
    }
    

}
